package com.zzj.hotel.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.zzj.hotel.core.entity.RoomResource;
import com.zzj.hotel.dao.RoomResourceDao;
import com.zzj.hotel.service.RoomResourceService;

public class RoomResourceServiceImpl implements RoomResourceService {
	private RoomResourceDao roomResourceDao;
	public RoomResourceDao getRoomResourceDao() {
		return roomResourceDao;
	}

	public void setRoomResourceDao(RoomResourceDao roomResourceDao) {
		this.roomResourceDao = roomResourceDao;
	}

	public RoomResource findById(String id) {
		Map<String, Object> queryMap = new HashMap<String, Object>();
		queryMap.put(RoomResource.RESOURCEID, id);
		return roomResourceDao.selectOne(queryMap);
	}

	public List<RoomResource> findAll() {
		return roomResourceDao.selectList(null);
	}

	public void update(RoomResource roomResource) {
		roomResourceDao.update(roomResource);
	}

	public void insert(RoomResource roomResource) {
		roomResourceDao.insert(roomResource);
	}

	public void deleteById(String id) {
		Map<String, Object> queryMap = new HashMap<String, Object>();
		queryMap.put(RoomResource.RESOURCEID, id);
		roomResourceDao.delete(queryMap);
	}

}
